package cn.txun.csmall.product.service;

//基于组合的方式，对某个类的方法进行增强
public class LogServiceImpl implements MailService {

    private MailService maiService;

    LogServiceImpl(MailService maiService){
        this.maiService = maiService;
    }

    public void setMaiService(MailService maiService) {
        this.maiService = maiService;
    }

    public void sendMail(){
        long start = System.currentTimeMillis();
        maiService.sendMail();
        long end = System.currentTimeMillis();
        System.out.println(end-start);
    }


}
